﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HotelMatchUtility.Utility
{
    public class Y_FileReader
    {
        public static List<string> ReadIdFromFile(string filePath)
        {
            int counter = 0;
            string line;
            List<string> result = new List<string>(); 
            // Read the file and display it line by line.
            using (System.IO.StreamReader file =
                new System.IO.StreamReader(filePath))
            {
                while ((line = file.ReadLine()) != null)
                {
                    result.Add(line);
                    counter++;
                }
            }
            return result;
        }

        public static List<HotelCodeLos> ReadEntityFromFile(string filePath)
        {  
            int counter = 0;
            string line;
            List<HotelCodeLos> result = new List<HotelCodeLos>(); 
            // Read the file and display it line by line.
            using (System.IO.StreamReader file =
                new System.IO.StreamReader(filePath))
            {
                while ((line = file.ReadLine()) != null)
                {
                    string[] param = line.Split(',');
                    result.Add(new HotelCodeLos() { hotelCode = param[0], LOS = param[1] });
                    counter++;
                }
            }
            return result;
        }
    }

    public struct HotelCodeLos
    {
        public string hotelCode{get;set;}
        public string LOS{get;set;}
    }
}
